
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.1.1 JSON文本类型 · 命令进阶</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../../styles/website.css">
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="formatting.html" />
    
    
    <link rel="prev" href="json.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    引言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../concepts/concepts.html">
            
                <a href="../../concepts/concepts.html">
            
                    
                    1 基础概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../concepts/space.html">
            
                <a href="../../concepts/space.html">
            
                    
                    1.1 坐标、朝向、区块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../concepts/time.html">
            
                <a href="../../concepts/time.html">
            
                    
                    1.2 时间、顺序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../concepts/execution.html">
            
                <a href="../../concepts/execution.html">
            
                    
                    1.3 命令执行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../concepts/selector/selector.html">
            
                <a href="../../concepts/selector/selector.html">
            
                    
                    1.4 目标选择器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../../concepts/stats.html">
            
                <a href="../../concepts/stats.html">
            
                    
                    1.5 命令执行统计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../common-format.html">
            
                <a href="../common-format.html">
            
                    
                    2 常用命令格式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="json.html">
            
                <a href="json.html">
            
                    
                    2.1 JSON文本
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.3.1.1" data-path="type.html">
            
                <a href="type.html">
            
                    
                    2.1.1 JSON文本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="formatting.html">
            
                <a href="formatting.html">
            
                    
                    2.1.2 JSON样式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.3" data-path="event.html">
            
                <a href="event.html">
            
                    
                    2.1.3 JSON事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.4" data-path="array.html">
            
                <a href="array.html">
            
                    
                    2.1.4 JSON分项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.5" data-path="sign-book.html">
            
                <a href="sign-book.html">
            
                    
                    2.1.5 告示牌及成书
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.6" data-path="other.html">
            
                <a href="other.html">
            
                    
                    2.1.6 杂项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.7" data-path="keys.html">
            
                <a href="keys.html">
            
                    
                    2.1.A 附录: keybind列表
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../nbt/nbt.html">
            
                <a href="../nbt/nbt.html">
            
                    
                    2.2 NBT及结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../nbt/simple.html">
            
                <a href="../nbt/simple.html">
            
                    
                    2.2.1 基本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../nbt/example.html">
            
                <a href="../nbt/example.html">
            
                    
                    2.2.2 NBT实战
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../../command/command.html">
            
                <a href="../../command/command.html">
            
                    
                    3 如何执行命令
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../command/chat.html">
            
                <a href="../../command/chat.html">
            
                    
                    3.1 聊天栏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../command/cb.html">
            
                <a href="../../command/cb.html">
            
                    
                    3.2 命令方块简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../../command/function.html">
            
                <a href="../../command/function.html">
            
                    
                    3.3 命令函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../../scoreboard/scoreboard.html">
            
                <a href="../../scoreboard/scoreboard.html">
            
                    
                    4 记分板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../../scoreboard/objective.html">
            
                <a href="../../scoreboard/objective.html">
            
                    
                    4.1 记分板变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../../scoreboard/team.html">
            
                <a href="../../scoreboard/team.html">
            
                    
                    4.2 记分板队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../../scoreboard/tag.html">
            
                <a href="../../scoreboard/tag.html">
            
                    
                    4.3 记分板标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../../scoreboard/command.html">
            
                <a href="../../scoreboard/command.html">
            
                    
                    4.4 记分板命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../../scoreboard/example.html">
            
                <a href="../../scoreboard/example.html">
            
                    
                    4.5 记分板实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.5.1" data-path="../../scoreboard/examples/example1.html">
            
                <a href="../../scoreboard/examples/example1.html">
            
                    
                    4.5.1 循环电路|记分板的基础操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.2" data-path="../../scoreboard/examples/example2.html">
            
                <a href="../../scoreboard/examples/example2.html">
            
                    
                    4.5.2 自定义命令|stats与记分板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.3" data-path="../../scoreboard/examples/example3.html">
            
                <a href="../../scoreboard/examples/example3.html">
            
                    
                    4.5.3 击杀率|operation与准则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.4" data-path="../../scoreboard/examples/example4.html">
            
                <a href="../../scoreboard/examples/example4.html">
            
                    
                    4.5.4 漂亮的排名|显示与队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.5" data-path="../../scoreboard/examples/example5.html">
            
                <a href="../../scoreboard/examples/example5.html">
            
                    
                    4.5.5 简单登入系统|function与综合运用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../../logic/logic.html">
            
                <a href="../../logic/logic.html">
            
                    
                    5 基础逻辑
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../logic/enum.html">
            
                <a href="../../logic/enum.html">
            
                    
                    5.1 穷举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../../logic/score.html">
            
                <a href="../../logic/score.html">
            
                    
                    5.2 分数处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../../logic/bool.html">
            
                <a href="../../logic/bool.html">
            
                    
                    5.3 布尔逻辑
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../../logic/loop.html">
            
                <a href="../../logic/loop.html">
            
                    
                    5.4 循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../../logic/event.html">
            
                <a href="../../logic/event.html">
            
                    
                    5.5 事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../../logic/marker.html">
            
                <a href="../../logic/marker.html">
            
                    
                    5.6 实体Marker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../../logic/execute.html">
            
                <a href="../../logic/execute.html">
            
                    
                     5.7 execute进阶
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../../practise/practise.html">
            
                <a href="../../practise/practise.html">
            
                    
                    6 实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../../practise/objects.html">
            
                <a href="../../practise/objects.html">
            
                    
                    6.1 游戏内物件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../../practise/test-debug.html">
            
                <a href="../../practise/test-debug.html">
            
                    
                    6.2 命令系统测试及调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../../practise/examples/examples.html">
            
                <a href="../../practise/examples/examples.html">
            
                    
                    6.3 更多命令系统例子
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.3.1" data-path="../../practise/examples/furnace.html">
            
                <a href="../../practise/examples/furnace.html">
            
                    
                    6.3.1 熔炉过热系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.2" data-path="../../practise/examples/badapple.html">
            
                <a href="../../practise/examples/badapple.html">
            
                    
                    6.3.2 毒苹果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.3" data-path="../../practise/examples/rain.html">
            
                <a href="../../practise/examples/rain.html">
            
                    
                    6.3.3 下雨检测
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.4" data-path="../../practise/examples/chest_replace.html">
            
                <a href="../../practise/examples/chest_replace.html">
            
                    
                    6.3.4 替换方块实体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.5" data-path="../../practise/examples/skill.html">
            
                <a href="../../practise/examples/skill.html">
            
                    
                    6.3.5 技能系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.6" data-path="../../practise/examples/crown.html">
            
                <a href="../../practise/examples/crown.html">
            
                    
                    6.3.6 皇冠系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.7" data-path="../../practise/examples/blackhole.html">
            
                <a href="../../practise/examples/blackhole.html">
            
                    
                    6.3.7 黑洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.8" data-path="../../practise/examples/login.html">
            
                <a href="../../practise/examples/login.html">
            
                    
                    6.3.8 登录系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../../data-files/data-files.html">
            
                <a href="../../data-files/data-files.html">
            
                    
                    7 游戏文件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../../data-files/resourcepack/resourcepack.html">
            
                <a href="../../data-files/resourcepack/resourcepack.html">
            
                    
                    7.1 资源包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1.1" data-path="../../data-files/resourcepack/textures.html">
            
                <a href="../../data-files/resourcepack/textures.html">
            
                    
                    7.1.1 材质
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.2" data-path="../../data-files/resourcepack/models.html">
            
                <a href="../../data-files/resourcepack/models.html">
            
                    
                    7.1.2 模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.3" data-path="../../data-files/resourcepack/sound.html">
            
                <a href="../../data-files/resourcepack/sound.html">
            
                    
                    7.1.3 声音
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../../data-files/loot-table.html">
            
                <a href="../../data-files/loot-table.html">
            
                    
                    7.2 Loot table
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../../data-files/advancements/advancements.html">
            
                <a href="../../data-files/advancements/advancements.html">
            
                    
                    7.3 Advancement
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.3.1" data-path="../../data-files/advancements/examples.html">
            
                <a href="../../data-files/advancements/examples.html">
            
                    
                    Advancement例子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" >
            
                <span>
            
                    
                    8 杂项
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" >
            
                <a target="_blank" href="https://commandtutorials.neocities.org/">
            
                    
                    8.1 其他资源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../../misc/success.html">
            
                <a href="../../misc/success.html">
            
                    
                    8.2 如何成为一个成功的CBer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../../misc/question.html">
            
                <a href="../../misc/question.html">
            
                    
                    8.3 问问题的技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../../misc/quotes.html">
            
                <a href="../../misc/quotes.html">
            
                    
                    8.4 其他CBer的建言
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >2.1.1 JSON文本类型</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="json&#x6587;&#x672C;&#x7C7B;&#x578B;">JSON&#x6587;&#x672C;&#x7C7B;&#x578B;</h1>
<p>&#x6700;&#x57FA;&#x7840;&#x7684;JSON&#x6587;&#x672C;&#x7C7B;&#x578B;&#x53EF;&#x88AB;&#x5206;&#x4E3A;5&#x7C7B;&#xFF1A;</p>
<ul>
<li>text-&#x6587;&#x672C;</li>
<li>selector-&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;</li>
<li>score-&#x5206;&#x6570;</li>
<li>translate-&#x7FFB;&#x8BD1;</li>
<li>keybind-&#x663E;&#x793A;&#x6309;&#x94AE;</li>
</ul>
<p>&#x503C;&#x5F97;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x867D;&#x7136;&#x8FD9;&#x4E94;&#x4E2A;&#x90FD;&#x662F;&#x6587;&#x672C;&#x5BF9;&#x8C61;&#x4E2D;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x8FD9;5&#x7C7B;&#x6587;&#x672C;&#x7C7B;&#x578B;&#x5728;&#x5355;&#x4E2A;&#x5BF9;&#x8C61;&#xFF08;&#x540C;&#x4E00;&#x6BB5;&#x6587;&#x5B57;&#xFF09;&#x4E2D;&#x53EA;&#x80FD;&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A;&#x3002;<br>&#x4E0D;&#x7136;&#x4F1A;&#x4E92;&#x76F8;&#x8986;&#x76D6;&#xFF0C;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x80FD;&#x751F;&#x6548;&#x3002;<br>&#x5173;&#x4E8E;&#x540C;&#x65F6;&#x4F7F;&#x7528;&#x591A;&#x4E2A;&#x6587;&#x672C;&#x7C7B;&#x578B;&#x7684;&#x60C5;&#x51B5;&#xFF0C;&#x6211;&#x4EEC;&#x4F1A;&#x5728;&#x4E4B;&#x540E;&#x7684;&#x7AE0;&#x8282;&#x8FDB;&#x884C;&#x8BA8;&#x8BBA;&#x3002;</p>
<h2 id="text-&#x6587;&#x672C;">text-&#x6587;&#x672C;</h2>
<p>text&#x53EF;&#x8C13;&#x662F;&#x6E38;&#x620F;&#x5185;&#x6700;&#x57FA;&#x672C;&#x7684;&#x7C7B;&#x578B;&#x3002;<br>&#x529F;&#x80FD;&#x5341;&#x5206;&#x7B80;&#x5355;&#xFF0C;&#x5C31;&#x662F;&#x663E;&#x793A;&#x4F60;&#x6307;&#x5B9A;&#x7684;&#x6587;&#x5B57;&#x3002;</p>
<p>&#x6700;&#x57FA;&#x672C;&#x7684;&#x683C;&#x5F0F;&#x4E3A;&#xFF1A;</p>
<pre><code>&quot;text&quot;:&quot;&lt;&#x6587;&#x672C;&#x5185;&#x5BB9;&gt;&quot;
</code></pre><p>&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;text&quot;:&quot;Hello World&quot;}
</code></pre><p><img src="images/1.png" alt="1"></p>
<p>&#x987A;&#x5E26;&#x4E00;&#x63D0;&#xFF0C;&#x5728;&#x5185;&#x5BB9;&#x4E2D;&#x63D2;&#x5165;<code>\n</code>&#x53EF;&#x4EE5;&#x8BA9;&#x6587;&#x5B57;&#x6362;&#x884C;&#xFF08;&#x53EA;&#x9650;&#x4E8E;<code>&#x6210;&#x4E66;</code>&#x548C;<code>tellraw</code>&#x547D;&#x4EE4;&#xFF09;</p>
<p>&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;text&quot;:&quot;Hello\nWorld&quot;}
</code></pre><p><img src="images/3.png" alt="2"></p>
<h2 id="selector-&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;">selector-&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;</h2>
<p>selector&#x7684;&#x4F5C;&#x7528;&#x5C31;&#x662F;&#x663E;&#x793A;&#x9009;&#x62E9;&#x5668;&#x9009;&#x62E9;&#x5230;&#x7684;&#x5B9E;&#x4F53;&#x540D;&#x79F0;&#xFF0C;&#x4E0E;&#x547D;&#x4EE4;&#x4E2D;&#x7684;&#x9009;&#x62E9;&#x5668;&#x683C;&#x5F0F;&#x4E00;&#x81F4;</p>
<p>&#x57FA;&#x672C;&#x683C;&#x5F0F;&#x4E3A;</p>
<pre><code>&quot;selector&quot;:&quot;&lt;&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;&gt;&quot;
</code></pre><p>&#x9009;&#x62E9;&#x7B26;&#x5C31;&#x5982;&#x5E73;&#x65F6;&#x4F7F;&#x7528;&#x4E00;&#x822C;&#x8F93;&#x5165;&#x5C31;&#x53EF;&#x4EE5;&#x4E86;<br>&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;selector&quot;:&quot;@p&quot;}
</code></pre><p><img src="images/4.png" alt="4"></p>
<p>&#x5982;&#x679C;&#x4E16;&#x754C;&#x5185;&#x53EA;&#x6709;&#x6211;&#x548C;&#x4E00;&#x53EA;&#x540D;&#x4E3A;GGG&#x7684;&#x732A;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;selector&quot;:&quot;@e&quot;}
</code></pre><p><img src="images/5.png" alt="5"></p>
<p>&#x503C;&#x5F97;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x9009;&#x62E9;&#x5668;&#x53C2;&#x6570;&#xFF08;&#x5373;&#x8DDF;&#x968F;&#x5728;&#x9009;&#x62E9;&#x7B26;&#x540E;&#x7684;[]&#x90E8;&#x5206;&#xFF09;&#x4E5F;&#x53EF;&#x4F7F;&#x7528;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;selector&quot;:&quot;@e[type=Pig]&quot;}
</code></pre><p><img src="images/6.png" alt="6"></p>
<blockquote>
<p>&#x6CE8;&#x610F;:<br>JSON&#x6587;&#x672C;&#x91CC;&#x7684;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x5305;&#x62EC;&#x63A5;&#x4E0B;&#x6765;&#x7684;score&#x4E2D;name&#x4F7F;&#x7528;&#x7684;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x5927;&#x90E8;&#x5206;&#x90FD;&#x662F;&#x4EE5;&#x547D;&#x4EE4;&#x6267;&#x884C;&#x4F4D;&#x7F6E;&#x4F5C;&#x4E3A;&#x539F;&#x70B9;&#x3002;<br>&#x5982;<code>tellraw</code>&#x53CA;<code>title</code>&#x547D;&#x4EE4;&#x4EE5;&#x547D;&#x4EE4;&#x6267;&#x884C;&#x70B9;&#x4E3A;&#x539F;&#x70B9;&#xFF0C;&#x4E66;&#x672C;&#x4EE5;&#x6253;&#x5F00;&#x7684;&#x73A9;&#x5BB6;&#x7684;&#x4F4D;&#x7F6E;&#x4E3A;&#x539F;&#x70B9;&#xFF0C;&#x53EA;&#x6709;&#x724C;&#x5B50;&#x662F;&#x4EE5;&#x724C;&#x5B50;&#x5750;&#x6807;&#x4E3A;&#x539F;&#x70B9;</p>
</blockquote>
<h2 id="score-&#x5206;&#x6570;">score-&#x5206;&#x6570;</h2>
<p>score&#x7528;&#x4E8E;&#x663E;&#x793A;<strong>&#x7279;&#x5B9A;&#x76EE;&#x6807;&#x7684;&#x7279;&#x5B9A;&#x5206;&#x6570;</strong>&#xFF0C;&#x9700;&#x8981;&#x5BF9;&#x8BB0;&#x5206;&#x677F;&#x7684;&#x77E5;&#x8BC6;&#xFF08;&#x8BE6;&#x89C1;&#x4E4B;&#x540E;&#x7684;&#x7AE0;&#x8282;&#xFF09;&#x3002;</p>
<p>&#x683C;&#x5F0F;&#x4E3A;&#xFF1A;</p>
<pre><code>&quot;score&quot;:{&quot;name&quot;:&quot;&lt;&#x5BF9;&#x8C61;&#x540D;&gt;&quot;,&quot;objective&quot;:&quot;&lt;&#x53D8;&#x91CF;&#x540D;&gt;&quot;}
</code></pre><p><strong>&#x5BF9;&#x8C61;&#x540D;</strong> &#x5373;&#x4E3A;&#x9700;&#x8981;&#x9009;&#x4E2D;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x5982;&#x6307;&#x5B9A;&#x73A9;&#x5BB6;&#x540D;&#x79F0;<br><strong>&#x5206;&#x6570;&#x540D;</strong> &#x5C31;&#x662F;&#x6765;&#x81EA;&#x54EA;&#x4E00;&#x4E2A;&#x8BB0;&#x5206;&#x677F;&#x53D8;&#x91CF;</p>
<p>&#x4F8B;&#x5982;&#x6211;&#x4EEC;&#x521B;&#x5EFA;&#x4E86;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;<code>test</code>&#x7684;&#x8BB0;&#x5206;&#x677F;&#x53D8;&#x91CF;&#xFF0C;&#x91CC;&#x9762;&#x6709;&#x4E24;&#x4E2A;&#x73A9;&#x5BB6;&#xFF1A;<br><img src="images/7.png" alt="7"></p>
<p>&#x8F93;&#x5165;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;score&quot;:{&quot;name&quot;:&quot;Tester&quot;,&quot;objective&quot;:&quot;test&quot;}}
</code></pre><p><img src="images/9.png" alt="9"></p>
<p><code>name</code>&#x652F;&#x6301;&#x9009;&#x62E9;&#x7B26;&#xFF08;&#x4F46;&#x4E0D;&#x80FD;&#x4E3A;&#x591A;&#x9009;&#xFF0C;&#x5982;<code>@a</code>&#xFF09;&#xFF0C;&#x6211;&#x4EEC;&#x653E;&#x7F6E;&#x4E86;&#x4E00;&#x4E2A;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#xFF0C;&#x5E76;&#x8BA9;SYL&#x63A5;&#x8FD1;&#x4ED6;</p>
<p>&#x8F93;&#x5165;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;score&quot;:{&quot;name&quot;:&quot;@p&quot;,&quot;objective&quot;:&quot;test&quot;}}
</code></pre><p><img src="images/8.png" alt="8"></p>
<p><code>score</code>&#x5728;<code>tellraw</code>&#x547D;&#x4EE4;&#x4E2D;&#x8FD8;&#x6709;&#x4E00;&#x4E2A;&#x7279;&#x6B8A;&#x529F;&#x80FD;&#xFF0C;<code>name</code>&#x90E8;&#x5206;&#x8F93;&#x5165;<code>*</code>&#x7684;&#x8BDD;<br>&#x90A3;&#x4E48;<strong>&#x89C2;&#x5BDF;&#x8005;&#x81EA;&#x5DF1;</strong>&#x5C06;&#x4F1A;&#x4F5C;&#x4E3A;&#x5BF9;&#x8C61;&#xFF0C;&#x663E;&#x793A;&#x89C2;&#x5BDF;&#x8005;&#x7684;&#x5206;&#x6570;&#xFF08;&#x8FD9;&#x5728;&#x505A;&#x5730;&#x56FE;&#x7684;&#x65F6;&#x5019;&#x5341;&#x5206;&#x6709;&#x7528;&#xFF09;</p>
<p>&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code>tellraw @a {&quot;score&quot;:{&quot;name&quot;:&quot;*&quot;,&quot;objective&quot;:&quot;test&quot;}}
</code></pre><p>SYL&#x7684;&#x89C6;&#x89D2;&#xFF1A;<br><img src="images/8.png" alt="8"></p>
<p>Tester&#x7684;&#x89C6;&#x89D2;&#xFF1A;<br><img src="images/9.png" alt="9"></p>
<h3 id="translate-&#x7FFB;&#x8BD1;&#x6587;&#x4EF6;">translate-&#x7FFB;&#x8BD1;&#x6587;&#x4EF6;</h3>
<p>translate&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x5728;&#x6587;&#x672C;JSON&#x91CC;&#x5F15;&#x7528;&#x7FFB;&#x8BD1;&#x6587;&#x4EF6;&#x7684;&#x6587;&#x5B57;&#xFF0C;&#x683C;&#x5F0F;&#x4E3A;:</p>
<pre><code>&quot;translate&quot;:&quot;&#x7FFB;&#x8BD1;&#x8BC6;&#x522B;&#x5668;&quot;
</code></pre><p>&#x5982;</p>
<pre><code>&quot;translate&quot;:&quot;chat.link.warning&quot;
</code></pre><p>&#x7136;&#x800C;&#x7FFB;&#x8BD1;&#x6587;&#x4EF6;&#x7684;&#x6587;&#x5B57;&#x53EF;&#x4EE5;&#x6709;&#x53C2;&#x6570;&#xFF08;&#x90A3;&#x4E9B;<code>%s</code>&#xFF09;&#xFF0C;&#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x5C31;&#x53EF;&#x4EE5;&#x7528;with&#x6765;&#x4F20;&#x5165;&#x53C2;&#x6570;&#xFF08;&#x987A;&#x5E8F;&#x5BF9;&#x5E94;&#x7FFB;&#x8BD1;&#x6587;&#x4EF6;&#x5185;&#x7684;<code>%s</code>&#xFF09;&#xFF0C;&#x683C;&#x5F0F;&#x4E3A;:</p>
<pre><code>&quot;with&quot;:[&lt;&#x53C2;&#x6570;&#x5B57;&#x4E32;&#x5217;&#x8868;&gt;]
</code></pre><p>&#x6CE8;&#x610F;with&#x7684;&#x53C2;&#x6570;&#x53EF;&#x4EE5;&#x4E3A;JSON&#x6587;&#x672C;&#x3002;</p>
<p>&#x5982;</p>
<pre><code>&#x5047;&#x8BBE;&#x7FFB;&#x8BD1;&#x6587;&#x4EF6;&#x4E2D;&#x6709;&#x4E00;&#x884C;&#x4E3A;
custom.a=&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;: %s&#xFF0C;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;: %s

JSON&#x6587;&#x672C;&#x4E3A;
{&quot;translate&quot;:&quot;custom.a&quot;,&quot;with&quot;:[&quot;a&quot;,&quot;b&quot;]}

&#x8F93;&#x51FA;&#x5219;&#x4E3A;
&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;: a&#xFF0C;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;: b
</code></pre><hr>
<p>translate&#x9664;&#x4E86;&#x80FD;&#x591F;&#x7528;&#x4F5C;&#x7FFB;&#x8BD1;&#x4EE5;&#x5916;&#xFF0C;&#x4EA6;&#x80FD;&#x7528;&#x4F5C;&#x68C0;&#x67E5;&#x8D44;&#x6E90;&#x5305;&#xFF0C;&#x5982;</p>
<pre><code>{&quot;translate&quot;:&quot;custom.1&quot;,&quot;with&quot;:[{&quot;text&quot;:&quot;&#x8BF7;&#x70B9;&#x51FB;&#x8FD9;&#x91CC;&quot;,&quot;clickEvent&quot;:{&quot;action&quot;:&quot;run_command&quot;,&quot;value&quot;:&quot;/say &#x7528;&#x4E86;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x6750;&#x8D28;&#x5305;&quot;}}]}
</code></pre><p>&#x539F;&#x7248;&#x5F88;&#x660E;&#x663E;&#x662F;&#x6CA1;&#x6709;<code>custom.1</code>&#x8FD9;&#x4E2A;&#x7FFB;&#x8BD1;&#x8BC6;&#x522B;&#x5668;&#x7684;&#xFF0C;&#x6545;&#x6B64;&#x6CA1;&#x52A0;&#x8F7D;&#x8D44;&#x6E90;&#x5305;&#x7684;&#x7528;&#x6237;&#x770B;&#x5230;&#x7684;&#x5C31;&#x662F;<code>custom.1</code>&#xFF0C;&#x4E5F;&#x6CA1;&#x6CD5;&#x70B9;&#x51FB;&#x3002;&#x800C;&#x5730;&#x56FE;&#x7684;&#x81EA;&#x5B9A;&#x4E49;&#x8D44;&#x6E90;&#x5305;&#x5219;&#x80FD;&#x591F;&#x6DFB;&#x52A0;&#x6B64;&#x7FFB;&#x8BD1;&#x8BC6;&#x522B;&#x5668;&#xFF0C;&#x5982;</p>
<pre><code>custom.1=%s
</code></pre><p>&#x7136;&#x540E;&#x73A9;&#x5BB6;&#x5C31;&#x80FD;&#x70B9;&#x51FB;<code>&#x8BF7;&#x70B9;&#x51FB;&#x8FD9;&#x91CC;</code>&#x5E76;&#x89E6;&#x53D1;&#x547D;&#x4EE4;&#x4E86;&#x3002;&#x5982;&#x679C;&#x73A9;&#x5BB6;&#x6CA1;&#x6709;&#x4F7F;&#x7528;&#x8BE5;&#x8D44;&#x6E90;&#x5305;&#xFF0C;&#x5219;&#x53EA;&#x80FD;&#x770B;&#x7740;<code>custom.1</code>&#x5728;&#x90A3;&#x91CC;&#x5E72;&#x77AA;&#x773C;&#x4E86;&#x3002;</p>
<h2 id="keybind-&#x663E;&#x793A;&#x6309;&#x94AE;">Keybind-&#x663E;&#x793A;&#x6309;&#x94AE;</h2>
<p>Keybind&#x5C31;&#x662F;&#x5F15;&#x7528;&#x67D0;&#x4E9B;&#x7279;&#x6B8A;&#x6309;&#x94AE;&#xFF0C;&#x5982;&#x679C;&#x73A9;&#x5BB6;&#x4FEE;&#x6539;&#x4E86;&#x7684;&#x8BDD;&#x5C31;&#x663E;&#x793A;&#x73A9;&#x5BB6;&#x4FEE;&#x6539;&#x4E3A;&#x7684;&#x6309;&#x94AE;&#x3002;&#x5BF9;&#x5730;&#x56FE;&#x5236;&#x4F5C;&#x5341;&#x5206;&#x6709;&#x7528;&#xFF0C;&#x56E0;&#x4E3A;&#x6709;&#x65F6;&#x5019;&#x9700;&#x8981;&#x8BA9;&#x73A9;&#x5BB6;&#x6309;&#x67D0;&#x4E2A;&#x6309;&#x94AE;&#x7136;&#x800C;&#x73A9;&#x5BB6;&#x53EF;&#x80FD;&#x4F1A;&#x4FEE;&#x6539;&#x9ED8;&#x8BA4;&#x952E;&#x4F4D;&#x3002;&#xFF08;&#x6BD4;&#x5982;<code>&#x6309;F&#x88C5;&#x586B;</code>&#xFF09;</p>
<p>&#x683C;&#x5F0F;:</p>
<pre><code>{&quot;keybind&quot;:&quot;&lt;&#x6309;&#x952E;&gt;&quot;}
</code></pre><p>&#x6309;&#x952E;&#x6BD4;&#x5982;&#x662F;<code>key.drop</code>, <code>key.forward</code>&#x7B49;&#x7B49;&#x3002;<br>&#x5B8C;&#x6574;&#x7684;&#x6309;&#x952E;&#x5217;&#x8868;&#x5728;&#x8FD9;&#xFF1A;<a href="keys.html">&#x6309;&#x952E;&#x5217;&#x8868;</a></p>
<p>&#x4F8B;&#x5B50;:</p>
<pre><code>{&quot;keybind&quot;:&quot;key.drop&quot;}
{&quot;keybind&quot;:&quot;key.forward&quot;}
</code></pre><blockquote>
<p>&#x6CE8;&#x610F;: &#x5982;&#x679C;&#x6CA1;&#x6709;&#x8BBE;&#x7F6E;&#x8BE5;&#x952E;&#x4F4D;&#xFF0C;&#x5219;&#x4F1A;&#x663E;&#x793A;&#x4E3A;<code>None</code></p>
</blockquote>
<hr>
<p>&#x77E5;&#x9053;&#x4E86;&#x5982;&#x4F55;&#x5B9A;&#x4E49;&#x5185;&#x5BB9;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x5C31;&#x5F97;&#x4E3A;&#x6211;&#x4EEC;&#x7684;&#x5185;&#x5BB9;&#x641E;&#x70B9;&#x65B0;&#x610F;&#x601D;&#x4E86;&#x3002;<br>&#x63A5;&#x4E0B;&#x6765;&#x5C06;&#x4F1A;&#x4ECB;&#x7ECD;&#x5982;&#x4F55;&#x4E3A;&#x6587;&#x672C;&#x5BF9;&#x8C61;&#x52A0;&#x5165;&#x989C;&#x8272;&#x3001;&#x7C97;&#x4F53;&#x7B49;&#x6837;&#x5F0F;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="json.html" class="navigation navigation-prev " aria-label="Previous page: 2.1 JSON文本">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="formatting.html" class="navigation navigation-next " aria-label="Next page: 2.1.2 JSON样式">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"2.1.1 JSON文本类型","level":"1.3.1.1","depth":3,"next":{"title":"2.1.2 JSON样式","level":"1.3.1.2","depth":3,"path":"common-format/json/formatting.md","ref":"common-format/json/formatting.md","articles":[]},"previous":{"title":"2.1 JSON文本","level":"1.3.1","depth":2,"path":"common-format/json/json.md","ref":"common-format/json/json.md","articles":[{"title":"2.1.1 JSON文本类型","level":"1.3.1.1","depth":3,"path":"common-format/json/type.md","ref":"common-format/json/type.md","articles":[]},{"title":"2.1.2 JSON样式","level":"1.3.1.2","depth":3,"path":"common-format/json/formatting.md","ref":"common-format/json/formatting.md","articles":[]},{"title":"2.1.3 JSON事件","level":"1.3.1.3","depth":3,"path":"common-format/json/event.md","ref":"common-format/json/event.md","articles":[]},{"title":"2.1.4 JSON分项","level":"1.3.1.4","depth":3,"path":"common-format/json/array.md","ref":"common-format/json/array.md","articles":[]},{"title":"2.1.5 告示牌及成书","level":"1.3.1.5","depth":3,"path":"common-format/json/sign-book.md","ref":"common-format/json/sign-book.md","articles":[]},{"title":"2.1.6 杂项","level":"1.3.1.6","depth":3,"path":"common-format/json/other.md","ref":"common-format/json/other.md","articles":[]},{"title":"2.1.A 附录: keybind列表","level":"1.3.1.7","depth":3,"path":"common-format/json/keys.md","ref":"common-format/json/keys.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","lb2br","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"expandable-chapters":{},"lb2br":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"命令进阶","language":"en","gitbook":"*","description":"一份Minecraft命令教程"},"file":{"path":"common-format/json/type.md","mtime":"2017-07-29T09:12:46.407Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-08T10:37:55.949Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

